import {px2rpx} from "../../../../utils/tool";
import base_behavior from "../../../../behavior/base_behavior";

Component({
    behaviors:[base_behavior],
    properties: {
        images:{type:Array,value:[]},
        marginBottom:{
            type:Number, value:0,
            observer(data){
                if (data){
                    this.setData({
                        _marginBottom:px2rpx(data),
                    })
                }
            }
        },
        marginX: {
            type:Number, value:0,
            observer(data){
                if (data){
                    this.setData({
                        _marginX:px2rpx(data),
                    })
                }

            }
        },
        radius:{type:String, value:'fillet'},
        colNum:{type:String, value:'col_1'},
        imageSpace:{type:String, value:'no_image_space'}
    },
    data: {
        imgLi0Height:0,
        _marginBottom:0,
        _marginX:0,
    },
    methods: {
        imageLoad (e) {
            const self = this;
            wx.createSelectorQuery().in(this).select("#img_0").boundingClientRect(res => {

                self
                    .setData({
                        imgLi0Height:res.height + 'px'
                    })
            }).exec();
        }
    }
});
